package com.practice.controller.admin;

import com.practice.common.result.Result;
import com.practice.pojo.user.dto.UserDTO;
import com.practice.pojo.user.dto.UserQueryPageDTO;
import com.practice.service.user.UUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("yddUserController")
@RequestMapping("/ydd_user")
public class YddUserController {
    
    @Autowired
    private UUserService uUserService;
    
    @GetMapping("/rowInfo")
    public Result rowInfo(Long id){
        return uUserService.rowInfo(id);
    }
    @GetMapping("/list")
    public Result list(UserQueryPageDTO dto){
        return uUserService.list(dto);
    }
    @PostMapping("/add")
    public Result add(UserDTO dto){
        uUserService.add(dto);
        return Result.success();
    }
    @GetMapping("/del")
    public Result del(Long id){
        uUserService.del(id);
        return Result.success();
    }
    @PostMapping("/update")
    public Result update(UserDTO dto){
        uUserService.update(dto);
        return Result.success();
    }
}
